<template>
  <el-dialog
    top="30px"
    width="1000px"
    append-to-body
    :title="title"
    :close-on-click-modal="false"
    :before-close="beforeClose"
    :visible.sync="visible"
  >
    <flow-main v-bind="$attrs" v-on="$listeners" :flow-data="innerFlowData"></flow-main>
  </el-dialog>
</template>

<script>
import FlowMain from '@/credit/components/flow/Main'

export default {
  components: {
    FlowMain,
  },
  props: {
    visible: Boolean,
    title: String,
    flowData: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {
      innerFlowData: [],
    }
  },
  computed: {},
  watch: {
    visible(val) {
      if (val) {
        this.innerFlowData = this.flowData
      }
    },
  },
  created() {},
  mounted() {},
  methods: {
    beforeClose() {
      this.$emit('update:visible', false)
    },
  },
}
</script>

<style lang="scss" scoped></style>
